package com.easy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("shopping")
public class ShoppingPageCotroller {
    @RequestMapping("index")
    public String upload(){
        return "shopping/index.html";
    }

    @RequestMapping("shop")
    public String shop(){
        return "shopping/grid-shop.html";
    }

    @RequestMapping("login")
    public String login(){
        return "shopping/login.html";
    }

    @RequestMapping("cart")
    public String cart(){
        return "shopping/cart.html";
    }

    @RequestMapping("checkout")
    public String checkout(String productids,String counts, Model model){
        model.addAttribute("productids", productids);
        model.addAttribute("counts", counts);
        return "shopping/checkout.html";
    }

    @RequestMapping("detail")
    public String detail(){
        return "shopping/single-product.html";
    }

    @RequestMapping("personalinformation")
    public String personalinformation(){
        return "shopping/personalinformation.html";
    }

    @RequestMapping("useraddress")
    public String useraddress(){
        return "shopping/useraddress.html";
    }

    @RequestMapping("payment")
    public String payment(int orderid,Model model){
        model.addAttribute("orderid", orderid);
        return "shopping/payment.html";
    }


    @RequestMapping("orderdetails")
    public String orderdetails(int orderid){
        return "shopping/orderdetails.html";
    }
}
